MBS Script Search

mbs-script-search is a focused search UI for FileMaker/MBS script XML exports. It loads a Base64-encoded XML source, builds a client-side search index, and lets you search script names, script IDs, group paths, script steps, and step arguments from one interface.

The project is built with Vite and packaged as a single-file web app for easy embedding and deployment.

User Guide

What the search can find

The search can match in these areas:

Each result groups all matches per script, so one script can show multiple matching areas at once.

How to search

Type into the search field to search immediately. Input is debounced slightly, so the app waits a short moment before running the search.

The search is normalized before matching:

This means many common formatting differences are ignored automatically.

You can override the default case-insensitive behavior with the Case-sensitive search checkbox in the actions menu.

Search logic: Exact vs Tolerant

These buttons control how strictly terms are matched.

They apply only when the query mode is set to Text and case-sensitive search is not active.

Exact

Exact means no fuzzy typo matching is applied.

It still benefits from the app’s normalization and token segmentation, so it is not “case-sensitive exact” in the strict literal sense. In practice, Exact means:

Use Exact when you know the term, function name, script name, or ID closely enough and want tighter results.

Tolerant

Tolerant is the broader MiniSearch-driven mode.

In practice, Tolerant uses MiniSearch more directly, especially for script names, IDs, paths, and individual step areas. This means tolerant mode is much better suited for:

Examples:

Use Tolerant when you want MiniSearch to do the broader work for you.

Query mode: Text vs Regex

These buttons control how the content of the search field is interpreted.

Text

Text is the default mode.

In this mode, the app uses the existing normalized text search pipeline together with the selected Exact or Tolerant logic and the selected All or Any term mode.

If Case-sensitive search is enabled, Text mode switches to a case-sensitive exact matching path and Tolerant becomes inactive.

Regex

Regex treats the search field as a JavaScript regular expression.

In this mode:

Use Regex when you need advanced pattern matching that is more precise than text search.

Examples:

Practical notes:

Highlighting note:

Term mode: All vs Any

These buttons control how multiple search terms are combined.

They apply only when the query mode is set to Text.

They still apply when case-sensitive text search is active.

All

All query terms must match.

In practice, the current implementation requires all terms to be found within the same searchable area, for example:

This behavior is preserved in both Exact and Tolerant mode.

Use All to narrow the result list when you know multiple parts of the target text.

Any

Any one of the entered terms may match.

This is broader and helpful when:

This behavior is also preserved in both Exact and Tolerant mode.

Filters

After searching, you can reduce visible matches using the filter chips:

The chips also show counts, so you can see how many matches belong to each category.

Result behavior

Results support several interaction modes:

The summary line below the toolbar reports loading state, match counts, and empty states.

Actions menu

The vertical three-dot button opens a native browser popover. It currently contains:

The action buttons are configured to close the popover after a short delay, so transient button feedback remains visible. The checkboxes do not close the popover.

Copying results

Copy results copies the currently visible result set to the clipboard.

Full copy mode

If Summarized results only is not checked, each step is copied with full text:

  - Set Variable - Line 41: full step content here

Summarized copy mode

If Summarized results only is checked, step matches are copied in a condensed two-line format:

  - Set Variable - Line 41
  - Contents: shortened preview here

This is useful when you want compact output without losing the step identity.

Technical Reference

Runtime flow

The app starts in src/main.js, mounts the UI, then loads and indexes the XML data.

High-level flow:

  1. src/main.js mounts mountScriptSearchApp()
  2. Base64 XML is loaded from the search data module
  3. XML is decoded and sanitized
  4. Script nodes are collected from the XML
  5. MiniSearch index entries are built
  6. Searches run entirely client-side in the browser

Data source

The current data source is imported from:

The exported variable is:

The XML is:

Search index design

The index is built with MiniSearch.

Indexed fields:

Stored fields:

Each script contributes:

Matching behavior in more detail

The current implementation combines several matching layers:

Scoring and ranking

The current score boost configuration favors these fields:

This keeps likely script hits near the top while still surfacing deep step matches.

UI structure

Main UI responsibilities:

Configurable constants

These constants currently influence behavior directly in src/scriptSearchApp.js:

Constant Current value Effect
PAGE_SIZE 100 Number of result groups initially rendered before Show more is used.
SEARCH_INPUT_DEBOUNCE_MS 120 Delay before the search runs after typing.
INDEX_BATCH_SIZE 20 Number of scripts indexed per async batch.
MIN_PREFIX_TERM_LENGTH 2 Minimum length before prefix matching is used.
MIN_FUZZY_TERM_LENGTH 4 Minimum term length before tolerant fuzzy matching may activate.
STEP_PREVIEW_MAX_LINES 6 Step preview/UI threshold used in result rendering logic.
STEP_TOGGLE_MIN_LENGTH 220 Length threshold used for step expansion behavior.
COPY_SUMMARY_PREVIEW_LENGTH 200 Maximum number of characters included in summarized copy mode previews.
CONTROLS_POPOVER_OFFSET 8 Vertical spacing between the popover trigger and the popover.
CONTROLS_POPOVER_CLOSE_DELAY_MS 220 Delay before close-enabled popover actions close the menu.
LINKING_ENABLED true Enables deep-link/navigation behavior in result links.

Related configuration objects:

Build setup

The build uses Vite with:

Current behavior from vite.config.js:

Scripts

Available npm scripts from package.json:

Requirements

Summary

This project is a single-file, browser-based search tool for FileMaker/MBS script XML. It supports:

If you want to change how the search feels, the first place to check is src/scriptSearchApp.js, especially the search option arrays, the matching helpers, the score boosts, and the constants listed above.